import {reactive, ref} from 'vue'
import useMsg from '@/hooks/useMsg'


function useSystem<T> (fn?:Function) {
  const pagination = reactive({
    page: 1,
    pageSize: 10,
    itemCount: 0,
    onChange: (page: number) => {
      pagination.page = page
      if (fn) {
        fn()
      }
    },
  })
  const {error,success} = useMsg()
  const list = ref<T>()
  return{
    pagination,
    error,
    success,
    list
  }
}
export default useSystem
